﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<WebSite.Models.QueryBudgetModel>" %>
<%@ Import Namespace="WebSite.Models" %>
<%@ Import Namespace="WebSite.App_Code" %>
<%@ Import Namespace="WebSite.App_Data" %>

<%@ Register src="../Shared/BudgetTable.ascx" tagname="BudgetTable" tagprefix="uc_BT" %>
<%@ Register src="../Shared/BudgetFilter.ascx" tagname="BudgetFilter" tagprefix="uc_BF" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	QueryBudget
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript">
    
        function ExportExcel() {

            var x = window.open("../Download/QueryBudget?id=1<%=Model.GetQueryString() %>");
            x.focus();
        }

        function CreateTemplate() {

            var x = window.open("../Download/QueryBudget?id=2<%=Model.GetQueryString() %>");
            x.focus();

        }

    </script>

    <br />

    <% Html.BeginForm(); %>
    
    <uc_BF:BudgetFilter ID="ucFilter" runat="server" />
    
    <input type="submit" value="查询" />
    <%if (Model.U.HasRole(Role.MGR)) { %>
        <input type="button" value="导出" onclick="ExportExcel()"/>
        <input type="button" value="生成模板" onclick="CreateTemplate()"/>
    <% } %>&nbsp;    

    <br />

    <uc_BT:BudgetTable ID="ucMain" runat="server" />

    <% Html.EndForm(); %>

</asp:Content>
